from django.core.paginator import Paginator

def get_objects_page(objects_list=None,pageNum=1,perPage=12):
    pages = Paginator(objects_list,per_page=perPage)
    pageNum=int(pageNum)
    if pageNum<1 :
        pageNum=1
    if pageNum>pages.num_pages:
        pageNum=pages.num_pages
    page = pages.page(pageNum)
    return page,page.object_list